// @APIVersion 1.0.0
// @Title beego Test API
// @Description beego has a very cool tools to autogenerate documents for your API
// @Contact astaxie@gmail.com
// @TermsOfServiceUrl http://beego.me/
// @License Apache 2.0
// @LicenseUrl http://www.apache.org/licenses/LICENSE-2.0.html
package routers

import (
	"passport/controllers"

	"github.com/astaxie/beego"
)

func init() {
	beego.Router("/", &controllers.DefaultController{})
	beego.Router("/*", &controllers.DefaultController{})

	//第三方账号绑定
	beego.Router("/v1/account/login/third_account", &controllers.AccountController{}, "post:ThirdAccountLogin")

	//AccessToken验证
	beego.Router("/v1/account/accesstoken/validate", &controllers.AccountController{}, "get:ValidateAccessToken")

	//用户绑定账号查询
	beego.Router("/v1/user/bind-account/query", &controllers.AccountBindController{}, "get:QueryBindedAccount")

	//第三方账号绑定
	beego.Router("/v1/account/bind/third_account", &controllers.AccountBindController{}, "post:BindThirdAccount")

	//第三方账号解绑
	beego.Router("/v1/account/unbind/third_account", &controllers.AccountBindController{}, "post:UnbindThirdAccount")

	//微信绑定
	beego.Router("/v1/account/lb/bind", &controllers.JDXGController{}, "post:ThirdAccountBind")

	//手机账号更换
	beego.Router("/v1/account/mobile/change", &controllers.MobileChangeController{}, "post:MobileChange")

	//手机验证码发送
	beego.Router("/v1/captcha/mobile/send", &controllers.CaptchaController{}, "post:MobileCaptchaSend")

	//手机验证码验证
	beego.Router("/v1/captcha/mobile/validate", &controllers.CaptchaController{}, "post:MobileCaptchaValidate")

	//验证码查询
	beego.Router("/v1/captcha/lookup", &controllers.CaptchaController{}, "get:GetCapatchaInfo")

	//手机注册账号
	beego.Router("/v1/user/register/mobile", &controllers.RegisterController{}, "post:UserMobileRegister")

	//手机一键注册登录
	beego.Router("/v1/account/reglogin/mobile", &controllers.RegisterController{}, "post:QuickRegLogin")

	//web端手机注册账号
	beego.Router("/v1/user/register/mobile/byweb", &controllers.RegisterController{}, "post:UserMobileRegisterByWeb")

	//web端手机一键注册登录
	beego.Router("/v1/account/reglogin/mobile/byweb", &controllers.RegisterController{}, "post:QuickRegLoginByWeb")

	//自动登录
	beego.Router("/v1/account/autologin", &controllers.AutoLoginController{}, "get:AutoLogin")

	//手机密码登录
	beego.Router("/v1/account/login/mobile", &controllers.AccountController{}, "post:MobilePassLogin")

	//手机账号关联绑定
	beego.Router("/v1/account/bind/mobile", &controllers.AccountBindController{}, "post:BindMobileAccount")

	//手机重置密码
	beego.Router("/v1/user/password-reset/mobile", &controllers.PasswordNoLoginController{}, "post:MobilePasswdReset")

	//修改用户密码
	beego.Router("/v1/user/password/change", &controllers.PasswordController{}, "post:ChangePassword")

	//用户个人信息查询
	beego.Router("/v1/user/profile/get", &controllers.UserProfileController{}, "get:QueryUserProfile")
	beego.Router("/v1/userinfo/get", &controllers.UserInfoController{}, "get:QueryUserInfo")
	beego.Router("/v1/userthirdinfo/get", &controllers.UserInfoController{}, "get:QueryUserThirdInfo")
	beego.Router("/v1/user/profile/byaccount", &controllers.AccountController{}, "get:QueryUserInfoByAccount")

	//用户个人信息修改
	beego.Router("/v1/user/profile/update", &controllers.UserProfileController{}, "post:UpdateUserProfile")

	//用户头像上传
	beego.Router("/v1/user/avatar-base64/upload", &controllers.UserProfileController{}, "post:AvatarBase64Upload")

	//注册邀请码检查
	beego.Router("/v1/user/invitation-code/validate", &controllers.InvitationCheckController{}, "get:ValidateInviteCode")

	//账号管理-删除用户
	beego.Router("/v1/admin/passport/delete-user", &controllers.PassportAdminController{}, "get:DeletePassportByUserid")

	//第三方授权相关
	authorize := beego.NewNamespace("authorize",
		beego.NSNamespace("weixin",
			beego.NSInclude(&controllers.AuthorizeController{}),
		),
	)
	beego.AddNamespace(authorize)
}
